home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
lang_c
/
mikecom
/
rxcnt.asm
< prev
next >
Wrap
Assembly Source File
|
1987-05-15
|
958b
|
28 lines
title GET BYTES IN RX BUFFER
include subfx.h
; Mike Dumdei, 6 Holly Lane, Texarkana TX 75503
;****************************************************************************
; ASYNC_RXCNT -- Returns number of characters in the receive buffer that have
; not been read out. Returns R_RXERR if invalid port.
;****************************************************************************
begseg COMM_TEXT
publicproc _async_rxcnt
push bp
mov bp,sp
push si ;C stck frame, save regs
call __ck_port_arg ;ck for valid arg and load pointers
jz cnt_exit ;arg was bad if ZR set on rtrn
mov ax,RX_SIZE
sub ax,RX_FREE ;calc # bytes of unread bufr data
cnt_exit:
pop si
pop bp
ret ;restore regs and exit
_async_rxcnt endp
endseg COMM_TEXT
end